﻿<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes" method="html" encoding="utf-16" />
  <xsl:template match="/rss">
	  <h3>
		  <xsl:value-of select="channel/title" />
	  </h3>
	  <xsl:variable name="items" select="channel/item" />
	  <xsl:call-template name="DrawPosts" >
		  <xsl:with-param name="items" select="$items" />
	  </xsl:call-template>
  </xsl:template>

	<xsl:template name="DrawPosts">
		<xsl:param name="items"/>
		<xsl:for-each select="$items[position() &lt; 6]">
			<div style="margin:6px;">
				<strong>
					<a href="{link}">
						<xsl:value-of select="title"/>
					</a>
				</strong>
				<br />
				<xsl:value-of select="description" disable-output-escaping="yes"/>
				<xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;</xsl:text>

				<xsl:value-of select="pubDate"/>

				<xsl:if test="author">
					<xsl:text disable-output-escaping="yes">&amp;nbsp;by&amp;nbsp;</xsl:text>
					<xsl:value-of select="author"/>
				</xsl:if>
				<br />

			</div>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>